//----------------Sonic CD MODSETTINGS Menu Script-----------------//
//--------Scripted by Christian Whitehead 'The Taxman'--------//
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//

// Aliases
#alias Object.Value0			:	Object.Timer
#alias Object.Value1			:	Object.CurrentButton
#alias Object.Value2			:	Object.SelectedOptionName
#alias Object.Value3			:	Object.SelectedOptionPresent
#alias Object.Value4			:	Object.SelectedOptionPast
#alias Object.Value5			:	Object.SelectedOptionBadFuture
#alias Object.Value6			:	Object.SelectedOptionGoodFuture
#alias Object.Value7			:	Object.PlaySong

//Object[+4] and [+ArrayPos0] are blank objects just to add values
#alias Object[+4].Value1		:	Helper.VMCurrentButtom
#alias Object.Value2			:	Helper.FlickerState

//Object[33] is MenuHeading
#alias Object[33].State			:	MenuHeading.State
#alias Object[33].PropertyValue	:	MenuHeading.Header

//Object[-1] is MenuWindow
#alias Object[-1].State			:	MenuWindow.State
#alias Object[1].Value4			:	MenuWindow.BackTouchPress

#alias 0 	:	EXTRASMENU_ENTER_MENU
#alias 1 	:	EXTRASMENU_CONTROLS
#alias 3 	:	EXTRASMENU_SELECTED_OPTION
#alias 4	:	EXTRASMENU_EXIT_MENU
#alias 5	:	EXTRASMENU_FADEIN
#alias 6	:	EXTRASMENU_RETURN_TO_TITLE


// Menu Heading States
#alias 1	:	MENUHEADING_LEAVE_SCREEN

// Menu Heading Property Values
#alias 5	:	MAINMENU_HEADER

// Menu Window States
#alias 3	:	MENUWINDOW_SHRINK

// Menu Button States
#alias 1	:	MENUBUTTON_BUTTONS_IN

// Presentation Stages
#alias 0	:	STAGE_P_TITLE

// Global SFX
#alias 23	:	SFX_G_MENUBUTTON
#alias 27	:	SFX_G_SELECT

// Stage SFX
#alias 1	:	SFX_S_BACKBUTTON

#function StopSong

function StopSong
	if Object.PlaySong == 1
		PlayMusic(Options.SoundTrack)
		Object.PlaySong = 0
	end if
end function
sub ObjectMain
	switch Object.State
	case EXTRASMENU_ENTER_MENU
	//ModMenu SaveRam
	ReadSaveRam(512) // R2 Name
	Object.SelectedOptionName = SaveRam[512]
	
	ReadSaveRam(513) // Present OST
	Object.SelectedOptionPresent = SaveRam[513]
	
	ReadSaveRam(514) // Past OST
	Object.SelectedOptionPast = SaveRam[514]
	
	ReadSaveRam(515) // Good Future OST
	Object.SelectedOptionGoodFuture = SaveRam[515]
	
	ReadSaveRam(516) // Bad Future OST
	Object.SelectedOptionBadFuture = SaveRam[516]
	
#platform: Use_Origins
		if Options.PhysicalControls == false
			Object.CurrentButton = -1
		end if
#endplatform

#platform: Mobile
		if Options.PhysicalControls == false
			Object.CurrentButton = -1
		end if
#endplatform

		Object.XPos  = Screen.CenterX
		Object.XPos -= 126
		if Object.Timer < 256
			Object.Alpha  = Object.Timer
			Object.Timer += 6
		else
			Object.Timer = 0
			Object.Alpha = 255
			Object.State++
		end if
		break

	case EXTRASMENU_SELECTED_OPTION
		if Object.Timer < 30
			Object.Timer++
		else
		end if
		break

	case EXTRASMENU_CONTROLS
#platform: Standard
		CheckResult = true
#endplatform

#platform: Mobile
		CheckEqual(Options.PhysicalControls, true)
#endplatform

#platform: Use_Origins
		CheckEqual(Options.PhysicalControls, true)
#endplatform
		
		// 2011 Steam lacks Options.PhysicalControls, so we force it here first and the other platforms can override it
		if CheckResult == true
			if KeyPress[0].Up == true
				Object.CurrentButton--
				if Object.CurrentButton < 0
					Object.CurrentButton = 4
				end if
				PlaySfx(SFX_G_MENUBUTTON, false) 
				CallFunction(StopSong)
			end if

			if KeyPress[0].Down == true
				Object.CurrentButton++
				if Object.CurrentButton > 4
					Object.CurrentButton = 0
				end if
				PlaySfx(SFX_G_MENUBUTTON, false)
				CallFunction(StopSong)
			end if

		switch Object.CurrentButton
			case 0 // Name
				if KeyPress[0].Left == true
					Object.SelectedOptionName--
					if Object.SelectedOptionName < 0
						Object.SelectedOptionName = 2
					end if
					PlaySfx(SFX_G_MENUBUTTON, false)
					SaveRam[512] = Object.SelectedOptionName
					WriteSaveRAM(512) 
				end if
				
				if KeyPress[0].Right == true
					Object.SelectedOptionName++
					if Object.SelectedOptionName > 2
						Object.SelectedOptionName = 0
					end if
					PlaySfx(SFX_G_MENUBUTTON, false) 
					SaveRam[512] = Object.SelectedOptionName
					WriteSaveRAM(512)
				end if
				break
		
			case 1 //Present
				if KeyPress[0].Left == true
					Object.SelectedOptionPresent--
					if Object.SelectedOptionPresent < 0
						Object.SelectedOptionPresent = 3
					end if
					PlaySfx(SFX_G_MENUBUTTON, false) 
					CallFunction(StopSong)
					SaveRam[513] = Object.SelectedOptionPresent
					WriteSaveRAM(513)
				end if
				
				if KeyPress[0].Right == true
					Object.SelectedOptionPresent++
					if Object.SelectedOptionPresent > 3
						Object.SelectedOptionPresent = 0
					end if
					PlaySfx(SFX_G_MENUBUTTON, false) 
					CallFunction(StopSong)
					SaveRam[513] = Object.SelectedOptionPresent
					WriteSaveRAM(513)
				end if
				break
		
			case 2 //Past
				if KeyPress[0].Left == true
					Object.SelectedOptionPast--
					if Object.SelectedOptionPast < 0
						Object.SelectedOptionPast = 3
					end if
					PlaySfx(SFX_G_MENUBUTTON, false) 
					CallFunction(StopSong)
					SaveRam[514] = Object.SelectedOptionPast
					WriteSaveRAM(514)
				end if
				
				if KeyPress[0].Right == true
					Object.SelectedOptionPast++
					if Object.SelectedOptionPast > 3
						Object.SelectedOptionPast = 0
					end if
					PlaySfx(SFX_G_MENUBUTTON, false) 
					CallFunction(StopSong)
					SaveRam[514] = Object.SelectedOptionPast
					WriteSaveRAM(514)
				end if
				break
		
			case 3 //Good Future
				if KeyPress[0].Left == true
					Object.SelectedOptionGoodFuture--
					if Object.SelectedOptionGoodFuture < 0
						Object.SelectedOptionGoodFuture = 4
					end if
					PlaySfx(SFX_G_MENUBUTTON, false) 
					CallFunction(StopSong)
					SaveRam[515] = Object.SelectedOptionGoodFuture
					WriteSaveRAM(515)
				end if
				
				if KeyPress[0].Right == true
					Object.SelectedOptionGoodFuture++
					if Object.SelectedOptionGoodFuture > 4
						Object.SelectedOptionGoodFuture = 0
					end if
					PlaySfx(SFX_G_MENUBUTTON, false) 
					CallFunction(StopSong)
					SaveRam[515] = Object.SelectedOptionGoodFuture
					WriteSaveRAM(515)
				end if
				break
		
		case 4 //Bad Future
			if KeyPress[0].Left == true
				Object.SelectedOptionBadFuture--
				if Object.SelectedOptionBadFuture < 0
					Object.SelectedOptionBadFuture = 3
				end if
				PlaySfx(SFX_G_MENUBUTTON, false) 
				CallFunction(StopSong)
				SaveRam[516] = Object.SelectedOptionBadFuture
				WriteSaveRAM(516)
			end if
			
			if KeyPress[0].Right == true
				Object.SelectedOptionBadFuture++
				if Object.SelectedOptionBadFuture > 3
					Object.SelectedOptionBadFuture = 0
				end if
				PlaySfx(SFX_G_MENUBUTTON, false) 
				CallFunction(StopSong)
				SaveRam[516] = Object.SelectedOptionBadFuture
				WriteSaveRAM(516)
			end if
			break
		end switch
		
#platform: Use_Origins
		if KeyPress[0].ButtonB == true
			Object.State = EXTRASMENU_RETURN_TO_TITLE
			Object.Timer = 0
			StopMusic()
		end if
#endplatform

#platform: Use_Standalone
		if KeyPress[0].ButtonB == true
			Object.Timer = 248
			Object.State = EXTRASMENU_EXIT_MENU
			PlayStageSfx(SFX_S_BACKBUTTON, false)
		end if
#endplatform
		end if
		break
		
	case EXTRASMENU_EXIT_MENU
		if Object.Timer > 0
			Object.Alpha  = Object.Timer
			Object.Timer -= 8
		else
			Object.Type = TypeName[Blank Object]
			MenuWindow.State = MENUWINDOW_SHRINK
			//All of this is MenuButton objects
			Object[34].State = MENUBUTTON_BUTTONS_IN
			Object[35].State = MENUBUTTON_BUTTONS_IN
			Object[36].State = MENUBUTTON_BUTTONS_IN
			Object[37].State = MENUBUTTON_BUTTONS_IN
			Object[38].State = MENUBUTTON_BUTTONS_IN
			Object[39].State = MENUBUTTON_BUTTONS_IN
			Object[40].State = MENUBUTTON_BUTTONS_IN
			Object[41].State = MENUBUTTON_BUTTONS_IN
			Object[42].State = MENUBUTTON_BUTTONS_IN
			//End
			MenuHeading.State  = MENUHEADING_LEAVE_SCREEN
			MenuHeading.Header = MAINMENU_HEADER
		end if 
		CallFunction(StopSong)
		break

	case EXTRASMENU_FADEIN
		if Object.Timer > 0
			Object.Timer -= 8
		else
			PlayMusic(Options.Soundtrack)
		end if
		TempValue0 = Object.Timer
		if TempValue0 > 255
			TempValue0 = 255
		end if
		SetScreenFade(0, 0, 0, TempValue0)
		break

	case EXTRASMENU_RETURN_TO_TITLE
		Object.Timer += 4
		if Object.Timer == 384
			Stage.ActiveList = PRESENTATION_STAGE
			Stage.ListPos	 = STAGE_P_TITLE
			LoadStage()
		end if
		SetScreenFade(0, 0, 0, Object.Timer)
		break

	end switch
end sub


sub ObjectDraw
	switch Object.State
	case EXTRASMENU_ENTER_MENU
	case EXTRASMENU_CONTROLS
	case EXTRASMENU_SELECTED_OPTION
	case EXTRASMENU_LOAD_EXTRA_STAGE
	case EXTRASMENU_EXIT_MENU
	case EXTRASMENU_RETURN_TO_TITLE
		Object.YPos  = Screen.CenterY
		Object.YPos -= 87
		DrawSpriteScreenFX(0, FX_INK, Object.XPos, Object.YPos) // R2 Name
		DrawRect(85, 62, 254, 1, 64, 64, 64, 255) // Awful Line
		TempValue0 = Object.YPos
		TempValue0 += 31
		TempValue1 = Object.XPos
		TempValue1 += 128
		DrawSpriteScreenFX(1, FX_INK, Object.XPos, TempValue0) // R2 SoundTrack
		DrawSpriteScreenFX(32, FX_INK, TempValue1, TempValue0) // Press A to play song
		TempValue0 += 20
		DrawSpriteScreenFX(2, FX_INK, Object.XPos, TempValue0) // Present
		TempValue0 += 20
		DrawSpriteScreenFX(3, FX_INK, Object.XPos, TempValue0) // Past
		TempValue0 += 20
		DrawSpriteScreenFX(4, FX_INK, Object.XPos, TempValue0) // Bad Future
		TempValue0 += 20 
		DrawSpriteScreenFX(5, FX_INK, Object.XPos, TempValue0) // Good Future
		TempValue0 += 20
		DrawSpriteScreenFX(6, FX_INK, Object.XPos, TempValue0) // Author
		
		
		switch SaveRam[512] // Zone Name
			case 0	// Dubious Depths
				TempValue1 = Object.XPos
				TempValue1 += 128
				if Object.SelectedOptionName == 0
						if Object.CurrentButton == 0
							DrawSpriteScreenFX(10, FX_INK, TempValue1, Object.YPos) // Dubious Depths(Selected)
						else
							DrawSpriteScreenFX(7, FX_INK, TempValue1, Object.YPos) // Dubious Depths
						end if
				else
					DrawSpriteScreenFX(7, FX_INK, TempValue1, Object.YPos) // Dubious Depths
				end if
				break
				
			case 1	// Ridicule Root
				TempValue1 = Object.XPos
				TempValue1 += 128
					if Object.SelectedOptionName == 1
						if Object.CurrentButton == 0
							DrawSpriteScreenFX(11, FX_INK, TempValue1, Object.YPos) // Ridicule Root(Selected)
						else
							DrawSpriteScreenFX(8, FX_INK, TempValue1, Object.YPos) // Ridicule Root
						end if
					else
						DrawSpriteScreenFX(8, FX_INK, TempValue1, Object.YPos) // Ridicule Root
					end if
				break
			case 2	// Relic Ruins
				TempValue1 = Object.XPos
				TempValue1 += 128
					if Object.SelectedOptionName == 2
						if Object.CurrentButton == 0
							DrawSpriteScreenFX(12, FX_INK, TempValue1, Object.YPos) // Relic Ruins(Selected)
						else
							DrawSpriteScreenFX(9, FX_INK, TempValue1, Object.YPos) // Relic Ruins
						end if
					else
						DrawSpriteScreenFX(9, FX_INK, TempValue1, Object.YPos) // Relic Ruins
					end if
				break
		end switch
	
		TempValue3 = Object.XPos
		TempValue3 += 128
		TempValue4 = Object.YPos
		TempValue4 += 131
				
		switch SaveRam[513] // Present Music
			case 0	// Original
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 51
				
				if Object.SelectedOptionPresent == 0
						if Object.CurrentButton == 1
							DrawSpriteScreenFX(20, FX_INK, TempValue1, TempValue2) // Original(Selected)
							TempValue1 += 72
							DrawSpriteScreenFX(22, FX_INK, TempValue1, TempValue2) // JP(Selected)
							DrawSpriteScreenFX(29, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(2)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(13, FX_INK, TempValue1, TempValue2) // Original
							TempValue1 += 72
							DrawSpriteScreenFX(15, FX_INK, TempValue1, TempValue2) // JP
						end if
				end if
				break
				
			case 1	// US
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 51
					if Object.SelectedOptionPresent == 1
						if Object.CurrentButton == 1
							DrawSpriteScreenFX(21, FX_INK, TempValue1, TempValue2) // US(Selected)
							DrawSpriteScreenFX(28, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(3)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(14, FX_INK, TempValue1, TempValue2) // US
						end if
					end if
				break
				
			case 2	// EU
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 51
					if Object.SelectedOptionPresent == 2
						if Object.CurrentButton == 1
							DrawSpriteScreenFX(23, FX_INK, TempValue1, TempValue2) // EU(Selected)
							DrawSpriteScreenFX(31, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(4)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(16, FX_INK, TempValue1, TempValue2) // EU
						end if
					end if
				break
				
			case 3	// Alt. Mix 0
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 51
					if Object.SelectedOptionPresent == 3
						if Object.CurrentButton == 1
							DrawSpriteScreenFX(25, FX_INK, TempValue1, TempValue2) // Alt. Mix 0(Selected)
							DrawSpriteScreenFX(27, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(5)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(18, FX_INK, TempValue1, TempValue2) // Alt. Mix 0
						end if
					end if
				break
		end switch
		
		switch SaveRam[514] // Past Music
			case 0	// JP
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 71
				
				if Object.SelectedOptionPast == 0
						if Object.CurrentButton == 2
							DrawSpriteScreenFX(22, FX_INK, TempValue1, TempValue2) // JP
							DrawSpriteScreenFX(28, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(6)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(15, FX_INK, TempValue1, TempValue2) // JP
						end if
				end if
				break
				
			case 1	// EU
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 71
					if Object.SelectedOptionPast == 1
						if Object.CurrentButton == 2
							DrawSpriteScreenFX(23, FX_INK, TempValue1, TempValue2) // EU(Selected)
							DrawSpriteScreenFX(31, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(7)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(16, FX_INK, TempValue1, TempValue2) // EU
						end if
					end if
				break
				
			case 2	// Alt. Mix 0
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 71
					if Object.SelectedOptionPast == 2
						if Object.CurrentButton == 2
							DrawSpriteScreenFX(25, FX_INK, TempValue1, TempValue2) // Alt. Mix 0(Selected)
							DrawSpriteScreenFX(27, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(8)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(18, FX_INK, TempValue1, TempValue2) // Alt. Mix 0
						end if
					end if
				break
				
			case 3	// Alt. Mix 1
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 71
					if Object.SelectedOptionPast == 3
						if Object.CurrentButton == 2
							DrawSpriteScreenFX(26, FX_INK, TempValue1, TempValue2) // Alt. Mix 1(Selected)
							DrawSpriteScreenFX(30, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(9)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(19, FX_INK, TempValue1, TempValue2) // Alt. Mix 1
						end if
					end if
				break
		end switch
		
		switch SaveRam[515] // Good Future Music
			case 0	// JP
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 91
				
				if Object.SelectedOptionGoodFuture == 0
						if Object.CurrentButton == 3
							DrawSpriteScreenFX(22, FX_INK, TempValue1, TempValue2) // JP
							DrawSpriteScreenFX(28, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(10)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(15, FX_INK, TempValue1, TempValue2) // JP
						end if
				end if
				break
				
			case 1	// JP Sonic Stream
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 91
				
				if Object.SelectedOptionGoodFuture == 1
						if Object.CurrentButton == 3
							DrawSpriteScreenFX(24, FX_INK, TempValue1, TempValue2) // Sonic Stream(Selected)
							DrawSpriteScreenFX(29, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(11)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(17, FX_INK, TempValue1, TempValue2) // Sonic Stream
						end if
				end if
				break
				
			case 2	// US
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 91
					if Object.SelectedOptionGoodFuture == 2
						if Object.CurrentButton == 3
							DrawSpriteScreenFX(21, FX_INK, TempValue1, TempValue2) // US(Selected)
							DrawSpriteScreenFX(28, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(12)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(14, FX_INK, TempValue1, TempValue2) // US
						end if
					end if
				break
				
			case 3	// EU
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 91
					if Object.SelectedOptionGoodFuture == 3
						if Object.CurrentButton == 3
							DrawSpriteScreenFX(23, FX_INK, TempValue1, TempValue2) // EU(Selected)
							DrawSpriteScreenFX(31, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(13)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(16, FX_INK, TempValue1, TempValue2) // EU
						end if
					end if
				break
				
			case 4	// Alt. Mix 0
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 91
					if Object.SelectedOptionGoodFuture == 4
						if Object.CurrentButton == 3
							DrawSpriteScreenFX(25, FX_INK, TempValue1, TempValue2) // Alt. Mix 0(Selected)
							DrawSpriteScreenFX(27, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(14)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(18, FX_INK, TempValue1, TempValue2) // Alt. Mix 0
						end if
					end if
				break
		end switch
		
		switch SaveRam[516] // Bad Future Music
			case 0	// JP
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 111
				
				if Object.SelectedOptionBadFuture == 0
						if Object.CurrentButton == 4
							DrawSpriteScreenFX(22, FX_INK, TempValue1, TempValue2) // JP
							DrawSpriteScreenFX(28, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(15)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(15, FX_INK, TempValue1, TempValue2) // JP
						end if
				end if
				break
				
			case 1	// US
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 111
					if Object.SelectedOptionBadFuture == 1
						if Object.CurrentButton == 4
							DrawSpriteScreenFX(21, FX_INK, TempValue1, TempValue2) // US(Selected)
							DrawSpriteScreenFX(28, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(16)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(14, FX_INK, TempValue1, TempValue2) // US
						end if
					end if
				break
				
			case 2	// EU
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 111
					if Object.SelectedOptionBadFuture == 2
						if Object.CurrentButton == 4
							DrawSpriteScreenFX(23, FX_INK, TempValue1, TempValue2) // EU(Selected)
							DrawSpriteScreenFX(31, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(17)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(16, FX_INK, TempValue1, TempValue2) // EU
						end if
					end if
				break
				
			case 3	// Alt. Mix 0
				TempValue1 = Object.XPos
				TempValue1 += 128
				TempValue2 = Object.YPos
				TempValue2 += 111
					if Object.SelectedOptionBadFuture == 3
						if Object.CurrentButton == 4
							DrawSpriteScreenFX(25, FX_INK, TempValue1, TempValue2) // Alt. Mix 0(Selected)
							DrawSpriteScreenFX(27, FX_INK, TempValue3, TempValue4) // - Author
							if Object.PlaySong == 0 // No Spam? :(
								if KeyPress[0].ButtonA == true
									PlayMusic(18)
									Object.PlaySong = 1
								end if
							end if
						else
							DrawSpriteScreenFX(18, FX_INK, TempValue1, TempValue2) // Alt. Mix 0
						end if
					end if
				break
		end switch
		break
	end switch
end sub

sub ObjectStartup
	//PRESENT
		SetMusicTrack("JP/R2A.ogg", 2, true)// Original
		SetMusicTrack("US/R2A.ogg", 3, true)//US
		SetMusicTrack("EU/R2A.ogg", 4, true)// EU
		SetMusicTrack("ALT0/R2A.ogg", 5, true)// Alt. Mix 0
	//PAST
		SetMusicTrack("R2B.ogg", 6, true)// JP
		SetMusicTrack("EU/R2B.ogg", 7, true)// EU
		SetMusicTrack("ALT0/R2B.ogg", 8, true)// Alt.Mix 0
		SetMusicTrack("ALT1/R2B.ogg", 9, true)// Alt.Mix 1
	//GOOD FUTURE
		SetMusicTrack("JP/R2C.ogg", 10, true)// JP
		SetMusicTrack("JP/R2C_SonicStream.ogg", 11, true)// Sonic Stream
		SetMusicTrack("US/R2C.ogg", 12, true)//US
		SetMusicTrack("EU/R2C.ogg", 13, true)// EU
		SetMusicTrack("ALT0/R2C.ogg", 14, true)// Alt. Mix0
	//BAD FUTURE
		SetMusicTrack("JP/R2D.ogg", 15, true)// JP
		SetMusicTrack("US/R2D.ogg", 16, true)//US
		SetMusicTrack("EU/R2D.ogg", 17, true)// EU
		SetMusicTrack("ALT0/R2D.ogg", 18, true)// Alt. Mix0
		SetMusicTrack("ALT1/R2D.ogg", 19, true)// Alt.Mix 1
		
	Object.SelectedOptionName = SaveRam[512]
		LoadSpriteSheet("Menu/MenuGfx2_EN.gif")

	SpriteFrame(8, 8, 56, 13, 162, 646)			// #0 - R2 Name
	SpriteFrame(8, 8, 112, 13, 162, 660)		// #1 - R2 SoundTrack
	SpriteFrame(8, 8, 56, 13, 162, 674)			// #2 - Present
	SpriteFrame(8, 8, 32, 13, 219, 674)			// #3 - Past
	SpriteFrame(8, 8, 86, 13, 162, 702)			// #4 - Good Future
	SpriteFrame(8, 8, 80, 13, 162, 688)			// #5 - Bad Future
	SpriteFrame(8, 8, 56, 13, 162, 716)			// #6 - Author
	
	SpriteFrame(8, 8, 144, 13, 323, 616)			// #7 - Dubious Depths
	SpriteFrame(8, 8, 144, 13, 323, 633)			// #8 - Ridicule Root
	SpriteFrame(8, 8, 144, 13, 323, 650)			// #9 - Relic Ruins
	SpriteFrame(8, 8, 144, 13, 323, 667)			// #10 - Dubious Depths(Selected)
	SpriteFrame(8, 8, 144, 13, 323, 684)			// #11 - Ridicule Root(Selected)
	SpriteFrame(8, 8, 144, 13, 323, 701)			// #12 - Relic Ruins(Selected)
	
	SpriteFrame(8, 8, 64, 13, 162, 730)			// #13 - Original
	SpriteFrame(8, 8, 16, 13, 228, 730)			// #14 - US
	SpriteFrame(8, 8, 16, 13, 245, 730)			// #15 - JP
	SpriteFrame(8, 8, 15, 13, 262, 730)			// #16 - EU
	SpriteFrame(8, 8, 96, 13, 278, 730)			// #17 - Sonic Stream
	SpriteFrame(8, 8, 66, 13, 375, 730)			// #18 - Alt. Mix0
	SpriteFrame(8, 8, 66, 13, 442, 730)			// #19 - Alt. Mix1
	SpriteFrame(8, 8, 64, 13, 162, 744)			// #20 - Original(Selected)
	SpriteFrame(8, 8, 16, 13, 228, 744)			// #21 - US(Selected)
	SpriteFrame(8, 8, 16, 13, 245, 744)			// #22 - JP(Selected)
	SpriteFrame(8, 8, 15, 13, 262, 744)			// #23 - EU(Selected)
	SpriteFrame(8, 8, 96, 13, 278, 744)			// #24 - Sonic Stream(Selected)
	SpriteFrame(8, 8, 66, 13, 375, 744)			// #25 - Alt. Mix0(Selected)
	SpriteFrame(8, 8, 66, 13, 442, 744)			// #26 - Alt. Mix1(Selected)
	
	SpriteFrame(8, 8, 49, 13, 219, 716)			// #27 - Johney
	SpriteFrame(8, 8, 65, 13, 269, 716)			// #28 - AngelFox
	SpriteFrame(8, 8, 112, 13, 335, 716)		// #29 - Masafumi Ogata
	SpriteFrame(8, 8, 63, 13, 448, 716)			// #30 - Colterex
	SpriteFrame(8, 8, 65, 13, 249, 702)			// #31 - Jalex777
	
	SpriteFrame(8, 8, 113, 13, 262, 758)			// #32 - Press A to play song
end sub
